package com.zqu.service.impl;

import com.zqu.mapper.PManagerment.CarMapper;
import com.zqu.pojo.Car;
import com.zqu.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarServiceImpl implements CarService {

    @Autowired(required = false)
    private CarMapper carMapper;

    @Override
    public Car selectCarById(long id) {
        return carMapper.selectTById(id);
    }

    @Override
    public List<Car> selectList(Car car) {
        return carMapper.selectList(car);
    }

    @Override
    public boolean insertCar(Car car) {
        return carMapper.insertT(car)>0;
    }

    @Override
    public boolean updateCar(Car car) {
        return carMapper.updateT(car)>0;
    }

    @Override
    public boolean deleteCar(long id) {
        return carMapper.deleteT(id)>0;
    }

    @Override
    public boolean deleteCarByIds(String[] ids) {
        return carMapper.deleteTByIds(ids)>0;
    }
}
